import 'dart:convert';
import 'package:ichinesereader/models/assessment/questionRecordSection.dart';

QuestionRecordInfoResult questionRecordInfoResultFromJson(String str) =>
    QuestionRecordInfoResult.fromJson(json.decode(str));
String questionRecordInfoResultToJson(QuestionRecordInfoResult data) =>
    json.encode(data.toJson());

class QuestionRecordInfoResult {
  QuestionRecordInfoResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  QuestionRecordInfo? result;

  factory QuestionRecordInfoResult.fromJson(Map<String, dynamic> json) =>
      QuestionRecordInfoResult(
        status: json["status"],
        message: json["message"],
        result: json["result"] != null
            ? QuestionRecordInfo.fromJson(json["result"])
            : null,
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class QuestionRecordInfo {
  QuestionRecordInfo({
    this.recordStatus,
    this.commitTime,
    this.list,
    this.questionGroupId,
  });

  String? recordStatus;
  int? commitTime;
  List<QuestionRecordSection>? list;
  String? questionGroupId;

  factory QuestionRecordInfo.fromJson(Map<String, dynamic> json) =>
      QuestionRecordInfo(
        recordStatus: json["recordStatus"],
        commitTime: json["commitTime"],
        questionGroupId: json["questionGroupId"],
        list: json["list"] != null
            ? List<QuestionRecordSection>.from(
                json["list"].map((x) => QuestionRecordSection.fromJson(x)))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "recordStatus": recordStatus,
        "commitTime": commitTime,
        "questionGroupId": questionGroupId,
        "list": List<dynamic>.from(list!.map((x) => x.toJson())),
      };
}


// class QuestionRecordSection {
//   QuestionRecordSection({
//     this.introduction,
//     this.partType,
//     this.questions,
//   });

//   String? introduction;
//   String? partType;
//   List<QuestionDetails>? questions;

//   factory QuestionRecordSection.fromJson(Map<String, dynamic> json) =>
//       QuestionRecordSection(
//         introduction: json["introduction"],
//         partType: json["partType"],
//         questions: json["questions"] != null
//             ? List<QuestionDetails>.from(
//                 json["questions"].map((x) => QuestionDetails.fromJson(x)))
//             : null,
//       );

//   Map<String, dynamic> toJson() => {
//         "questions": List<dynamic>.from(questions!.map((x) => x.toJson())),
//       };
// }

